package org.apache.tomcat.util.digester;

import java.util.HashMap;
import java.util.Objects;

/**
 * Rule implementation that sets properties on the object at the top of the stack, based on
 * attributes with corresponding names.
 *
 * @author chentudong
 * @date 2024/2/20 19:33
 * @since 1.0
 */
public class SetPropertiesRule extends Rule {

  protected final HashMap<String, String> excludes;

  public SetPropertiesRule() {
    excludes = null;
  }

  public SetPropertiesRule(String[] exclude) {
    excludes = new HashMap<>();
    for (String s : exclude) {
      if (Objects.nonNull(s)) {
        this.excludes.put(s, s);
      }
    }
  }
}
